﻿/**
 * Proyecto: Cognitum
 * Global IT Services 2008
 * @author
 */
Cognitum.Polizas.Danhos.Pool.Editor = Ext.extend(Cognitum.Polizas.General.Editor, {

    esFlotilla: true,
    
    initComponent: function(){
        Ext.apply(this, {
            seccionesAdicionales: [{
                title: 'Ubicaciones',
                items: [
                    {
                        xtype: 'ag.list',
                        hideLabel: true,
                        entityName: 'UbicacionAsegurada',
                        name: 'Movimientos',
                        context: 'r.Poliza.Id =? and r.Estatus=1',
                        anchor: '99% 99%',
                        updateControls: function(value){
                            if (Ext.isEmpty(value)) {
                                return;
                            }
                            // menu config
                            this.canUpdate = this.canUpdate && value.EstatusPoliza == 0;
                            this.deleteMenuAction.setDisabled(!(this.canDelete && value.EstatusPoliza == 0));
                            this.newMenuAction.setDisabled(!(this.canNew && value.EstatusPoliza == 0));
                            this.newToolbarButton.setDisabled(!(this.canNew && value.EstatusPoliza == 0));
                        }
                    }
                ]
            }]
        });
        Cognitum.Polizas.Danhos.Pool.Editor.superclass.initComponent.apply(this, arguments);
    }
    
});

Ext.reg('pol.danhos.pool.editor', Cognitum.Polizas.Danhos.Pool.Editor);
